﻿using System;
using System.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using BadmintonApp.BLL.Interface;
using System.Reflection;

namespace BadmintonApp.Factory
{
    public class BllFactory
    {
        private static readonly string path = ConfigurationManager.AppSettings["BLLImpl"];

        private BllFactory() { }

        public static IActivityBLL CreateActivityBLL()
        {
            string className = path + ".ActivityBLL";
            return (IActivityBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IAnnouncementBLL CreateAnnouncementBLL()
        {
            string className = path + ".AnnouncementBLL";
            return (IAnnouncementBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IRechargeBLL CreateRechargeBLL()
        {
            string className = path + ".RechargeBLL";
            return (IRechargeBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IRoleBLL CreateRoleBLL()
        {
            string className = path + ".RoleBLL";
            return (IRoleBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IUsersBLL CreateUsersBLL()
        {
            string className = path + ".UsersBLL";
            return (IUsersBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IUsersOfActivityBLL CreateUsersOfActivityBLL()
        {
            string className = path + ".UsersOfActivityBLL";
            return (IUsersOfActivityBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IUsersOfRoleBLL CreateUsersOfRoleBLL()
        {
            string className = path + ".UsersOfRoleBLL";
            return (IUsersOfRoleBLL)Assembly.Load(path).CreateInstance(className);
        }
    }
}
